package com.ssyt.hiring.web.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ssyt.hiring.entity.ApplicationEntity;
import com.ssyt.hiring.entity.ResumeEntity;
import com.ssyt.hiring.entity.TalentEntity;
import com.ssyt.hiring.web.dao.ApplicationDao;
import com.ssyt.hiring.web.dao.ResumeDao;
import com.ssyt.hiring.web.dao.TalentDao;

@Service
public class TalentService {

	@Autowired
	private TalentDao talentDao;
	@Autowired
	private ResumeDao resumeDao;
	@Autowired
	private ApplicationDao applicationDao;

	/**
	 * 求职者登录
	 * 
	 * @return
	 */
	public TalentEntity talentLogin(TalentEntity talent) {
		return talentDao.talentLogin(talent);
	}

	/**
	 * 求职者注册
	 * 
	 * @return
	 */
	public void talentRegister(TalentEntity talent) {
		talentDao.talentRegister(talent);

	}

	/**
	 * 求职者注销
	 * 
	 * @return
	 */
	public void logout() {

		talentDao.logout();
	}

	/**
	 * 查询求职者信息
	 * 
	 * @return
	 */
	public TalentEntity getTalentInfo(int talentId) {
		return talentDao.getTalentInfo(talentId);
	}

	/**
	 * 求职者资料修改
	 */
	public void talentUpdate(TalentEntity talent) {

		talentDao.talentUpdate(talent);
	}

	/**
	 * Ajax查询所有的求职者信息
	 */
	public TalentEntity getTalentInfoByAjax(int resumeId, int talentId) {
		return talentDao.getTalentInfoByAjax(resumeId, talentId);

	}

	/**
	 * 查询求职者简历
	 * 
	 * @param talentId
	 * @return
	 */
	public List<ResumeEntity> getTalentResume(int myTalentId) {
		return resumeDao.getTalentResume(myTalentId);
	}

	public List<ApplicationEntity> getApplicationListInfo() {
		return applicationDao.getApplicationListInfo();
	}

	public boolean checkTalentName(String code) {
		return talentDao.checkTalentName(code);

	}

	public TalentDao getTalentDao() {
		return talentDao;
	}

	public void setTalentDao(TalentDao talentDao) {
		this.talentDao = talentDao;
	}

	public ResumeDao getResumeDao() {
		return resumeDao;
	}

	public void setResumeDao(ResumeDao resumeDao) {
		this.resumeDao = resumeDao;
	}

}
